<?php require_once dirname(__FILE__) . "/shared/config/config.php"; ?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="Content-type" value="text/html; charset=UTF-8" />
        <title>Index - Tesdo</title>
        <?php require_once DOCUMENT_ROOT . DIR_INCLUDE . 'head.php'; ?>
        <meta name="viewport" content="width=device-width" />
        <?php
        require_once DOCUMENT_ROOT . DIR_SHARED_DAO . "dao_sub_menu.php";
        require_once DOCUMENT_ROOT . DIR_SHARED_DAO . "dao_menu.php";

        $sub_menu_access = new dao_sub_menu();
        $menu_access = new dao_menu();
        if (!empty($_GET['menu_id'])) {
            $menu_id = $_GET['menu_id'];
            $menu = $menu_access->get_by_id($menu_id);
            $content = array();
            $content['feature_title'] = $menu['menu_feature_title'];
            $content['feature_content'] = $menu['menu_feature_content'];
            $content['title'] = "";
            $content['content'] = $menu['menu_content'];
                    
        }
        
        if (!empty($_GET['sub_menu_id'])) {
            $sub_menu_id = $_GET['sub_menu_id'];
            $content = $sub_menu_access->get_by_id($sub_menu_id);
            $content['title'] = "";
        }
        
        ?>
    </head>
    <body>
        <?php require_once DOCUMENT_ROOT . DIR_INCLUDE . 'header.php'; ?>

        <!-- Body -->
        <div id="body">
            <?php 
            if (!empty($content['feature_content'])) { ?>
            
            <section class="featured">
                <aside>
                    <p>
                    </p>
                    <ul>
                        <li><a href="<?php echo LINK_ROOT . '/'; ?>index.php" id="FeaturedContent_A4">Home</a></li>
                        <li><a href="<?php echo LINK_ROOT . '/'; ?>our_network.php" id="FeaturedContent_A5">Our Network</a></li>
                        <li><a href="<?php echo LINK_ROOT . '/'; ?>cor_values.php" id="FeaturedContent_A6">Core Values</a></li>
                        <li><a href="<?php echo LINK_ROOT . '/'; ?>cooperate_vision.php" id="FeaturedContent_A7">Vision</a></li>
                        <!--<li><a href="contact_us.php" id="FeaturedContent_A1">Contact Us</a></li>-->
                    </ul>
                </aside>

                <div class="content-wrapper">
                    <hgroup class="title">
                        <h2><?php echo $content['feature_title']; ?></h2>
                    </hgroup>
                    <div style="width: 780px;">
                        <?php echo $content['feature_content']; ?>
                    </div>
                </div>

            </section>
            <?php
            }
            ?>
            <section class="content-wrapper main-content clear-fix">
                <article>
                <?php
                if (!empty($content)) {
                    
                ?>
                <hgroup class="title">
                    <h1><?php echo $content['title']; ?></h1>
                
                
                <section class="contact">
                    <?php echo $content['content']; ?>
                </section>
                </hgroup>
                <hr/>
                <?php
                }
                ?>
                </article>
                <aside>
                    <?php require_once DOCUMENT_ROOT . DIR_INCLUDE . 'navbar.php'; ?>
                </aside>
            </section>
            
        </div>
        <!-- End Body -->

        <?php require_once DOCUMENT_ROOT . DIR_INCLUDE . 'footer.php'; ?>
    </body>
</html>